//
//  HHLoginWithPhoneNavi.h
//  HHBroker
//
//  Created by He Wei on 9/15/15.
//  Copyright © 2015 harry. All rights reserved.
//

#import <UIKit/UIKit.h>

enum LoginCancelResult {
    LoginCancekByUser,           //用户自主放弃
    LoginCancelBySignedPhone      //手机号尚未注册
};

typedef enum  LoginCancelResult LoginCancelResult;

@protocol HHLoginWithPhoneControllerDelegate;
@interface HHLoginWithPhoneNavi : UINavigationController

@property (nonatomic, assign) id <UINavigationControllerDelegate, HHLoginWithPhoneControllerDelegate> delegate;
@end

@protocol HHLoginWithPhoneControllerDelegate <NSObject>

@optional

/*
 *  重要：controller 不会主动dismiss自己，业务发起方需要在回调中dismiss它
 *  @param controller 使用[controller  dismiss...]
 *  @param response   登陆成功后服务器返回的response
 *
 */
- (void)loginWithPhoneViewController:(HHLoginWithPhoneNavi *)controller didFinishLoginWithResponse:(NSDictionary *)response;
- (void)loginWithPhoneViewController:(HHLoginWithPhoneNavi *)controller didCancelWithResult:(LoginCancelResult *)result;
@end

